package com.gexiaobao.pigeon.ui.adapter

import androidx.appcompat.widget.AppCompatImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.VideoInfoBean
import com.gexiaobao.pigeon.app.util.ImageLoaderManager
import com.gexiaobao.pigeon.databinding.ItemAuctionPigeonVideoBinding

/**
 * @Author      : hxw
 * @Date        : 2025/1/9 9:37
 * @Describe    :
 */
class AdapterAuctionPigeonVideo :
    BaseQuickAdapter<VideoInfoBean, DataBindBaseViewHolder>(R.layout.item_auction_pigeon_video) {
    override fun convert(holder: DataBindBaseViewHolder, item: VideoInfoBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemAuctionPigeonVideoBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        val ivItemFifteenCover = holder.getView<AppCompatImageView>(R.id.ivItemFifteenCover)
        ImageLoaderManager.loadImage(context, item.snapshot, ivItemFifteenCover)
    }
}